//把packages中的package.json复制到lib目录

const fs = require("fs");
const path = require("path");

// 指定 lib 目录的路径
const libDir = path.join(__dirname, "../lib");
const targetPath = path.join(libDir, "package.json");
const packageJsonDir = path.join(__dirname, "../packages/package.json");

fs.copyFile(packageJsonDir, targetPath, (err) => {
  if (err) throw err;
  console.log("package.json copied to lib directory");
});
//复制index.d.ts
const typesDir = path.join(__dirname, "../packages/index.d.ts");
const targetTypesDir = path.join(libDir, "index.d.ts");
fs.copyFile(typesDir, targetTypesDir, (err) => {
  if (err) throw err;
  console.log("package.json copied to lib directory");
});
